# -*- coding: utf-8 -*-

"""
@author: ji
@Remark: 设备型号信息表管理
"""
from app.device.models import DeviceModel
from dvadmin.utils.serializers import CustomModelSerializer
from dvadmin.utils.viewset import CustomModelViewSet


class DevicemodelSerializer(CustomModelSerializer):
    """
    序列化器
    """

    class Meta:
        model = DeviceModel
        fields = "__all__"
        read_only_fields = ["id"]
 

class DevicemodelViewSet(CustomModelViewSet):
    """
    设备型号信息表接口
    list:设备型号信息查询
    create:设备型号信息新增
    update:设备型号信息修改
    retrieve:设备型号信息单例
    destroy:设备型号信息删除
    multiple_delete:设备型号信息多删
    """
    queryset = DeviceModel.objects.order_by('modelname')
    serializer_class = DevicemodelSerializer
    # filter_fields = ['creator_id']

    # permission_classes = []
